<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
  <title> new document </title>
  <meta name="generator" content="editplus" />
  <meta name="author" content="" />
  <meta name="keywords" content="" />
  <meta name="description" content="" />
 </head>

 <body>
 <script type="text/javascript">
 <!--
	alert(navigator.appName);
 //-->
 </script>
  <script language="javascript">
function ui_onkeydown_handler()
{
var value;

if(navigator.appName == "Microsoft Internet Explorer")
{
value=window.event.keyCode;
switch (value)
{
case 116 : // F5
/* the following two lines will disable f5*/
event.keyCode = 0; 
event.returnValue = false;
}
}
else if(navigator.appName == "Netscape")
{
value = arguments[0].keyCode;
switch (value)
{
case 116 : // F5
/* the following two lines will disable f5*/
arguments[0].stopPropagation();
arguments[0].preventDefault();
}
}
}


if(navigator.appName == "Microsoft Internet Explorer")
{
document.attachEvent("onkeydown", ui_onkeydown_handler); // this will trigger the function when any key is pressed
}
else if(navigator.appName == "Netscape")
{
document.addEventListener("keydown", ui_onkeydown_handler,false);// this will trigger the function when any key is pressed
}
</script> 
<script language="JavaScript">
function disableCtrlKeyCombination(e)
{
        //list all CTRL + key combinations you want to disable
        var forbiddenKeys = new Array("a", "n", "c", "x", "v", "j", "r");
        var key;
        var isCtrl;

        if(window.event)
        {
                key = window.event.keyCode;     //IE
                if(window.event.ctrlKey)
                        isCtrl = true;
                else
                        isCtrl = false;
        }
        else
        {
                key = e.which;     //firefox
                if(e.ctrlKey)
                        isCtrl = true;
                else
                        isCtrl = false;
        }

        //if ctrl is pressed check if other key is in forbidenKeys array
        if(isCtrl)
        {
                for(i=0; i<forbiddenKeys .length; i++)
                {
                        //case-insensitive comparation
                        if(forbiddenKeys[i].toLowerCase() == String.fromCharCode(key).toLowerCase())
                        {
                                alert("Key combination CTRL + "
                                        +String.fromCharCode(key)
                                        +" has been disabled.");
                                return false;
                        }
                }
        }
        return true;
}
</script>
<input type="text" name="mytext" 
        onKeyPress="return disableCtrlKeyCombination(event);"
        onKeyDown="return disableCtrlKeyCombination(event);" />
 </body>
</html>
